package huixue.cn.com.rxapp.rx.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by gongdongyang 2019/7/18
 * Describe:
 */
public class Item implements Parcelable {

    private String name;
    private Class action;

    public Item(String name, Class action) {
        this.name = name;
        this.action = action;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Class getAction() {
        return action;
    }

    public void setAction(Class action) {
        this.action = action;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeSerializable(this.action);
    }

    protected Item(Parcel in) {
        this.name = in.readString();
        this.action = (Class) in.readSerializable();
    }

    public static final Creator<Item> CREATOR = new Creator<Item>() {
        @Override
        public Item createFromParcel(Parcel source) {
            return new Item(source);
        }

        @Override
        public Item[] newArray(int size) {
            return new Item[size];
        }
    };
}
